#include "udpServer.hpp"
#include <memory>

using namespace std;

using namespace Server;

void Usage(const string& proc)
{
    // cout << "\nUsage:\n\t" << proc << " local_ip local_port\n" << endl; 
    cout << "\nUsage:\n\t" << proc << " local_port\n" << endl; 
}

int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    uint16_t port = atoi(argv[1]);
    // string ip = argv[1];

    // unique_ptr<udpServer> usvr(new udpServer(port, ip));
    unique_ptr<udpServer> usvr(new udpServer(port));

    usvr->initServer();
    usvr->start();

    return 0;
}